Population class module

Module containing the Population grid class object.

Here all the functionality of a Population object is defined.

TODO: the save_snapshots and save_snapshot, are they actually distinct?

Tasks:
  • TODO: type the private functions

  • TODO: fix the correct object types for the default values of the bse_options

  • TODO: think of a clean and nice way to unload and remove the custom_logging_info library from memory (and from disk)

  • TODO: think of a nice way to remove the loaded grid_code/ generator from memory.

  • TODO: Some of the methods that we have defined in the (mixin) class are designed to be used as a portal to information (return_binary_c_version_info for example.) The current design is that they are all instance methods, but that is not always necessary. We can decorate them with @staticmethod, or @classmethod to make it easier to use them (https://realpython.com/instance-class-and-static-methods-demystified/)

class binarycpython.utils.population_class.Population(**kwargs)[source]

Bases: analytics, cache, dataIO, distribution_functions, grid_logging, population_options_defaults, HPC, metadata, Moe_di_Stefano_2017, spacing_functions, version_info, grid_sampling, monte_carlo_sampling, source_file_sampling, custom_generator_sampling, signal_handling, return_functions, ensemble, argument_handling, termination_functions, miscellaneous_functions, evolution_functions, failing_systems_functions, sampling_variables, custom_binary_c_logging, logging_functionality, Email

Population Object. Contains all the necessary functions to set up, run and process a population of systems

clean()[source]

Clean the contents of the population object so it can be reused.

Calling _pre_run_setup()

TODO: decide to deprecate this function

Return type

None

evolve()[source]

Entry point function of the whole object. From here, based on the settings, we set up a grid and (probably) evolve the population.

There are no direct arguments to this function, the population_options contain all the relevant settings.

TODO: create a pre-evolve function to handle all the things that need to be done before the evolution TODO: create a post-evolve function to handle all the things that need to be done before the evolution

Return type

None

Returns

a dictionary containing the analytics of the run.

jobID()[source]

Function to return the job ID number of this process as a string.

Normal processes return their process ID (PID) HPC processes return whatever HPC_jobID() gives.